var scrollFlag;
// /初始化地图
function initMap(url,paramsData){
    map.clearOverlays();//清除所有地图覆盖物
    RequestData (url,paramsData);
    if(allMapData.length==0 || mapDataStatus==false){
        return
    }
    createDeveloperProvince(allMapData);

}
//开发商省覆盖物
function createDeveloperProvince(mapDataList){
    mapDataList.forEach(function (data) {
        //自定义覆盖物
        function ComplexCustomOverlay(point, text,num){
            this._point = point;
            this._text = text;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
            div.style.color = "white";
            div.style.height = "80px";
            div.style.width = "80px";
            div.style.lineHeight = "62px";
            div.style.opacity = '0.9';
            div.style.textAlign = "center";
            div.style.borderRadius = "50%";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            if(parseInt(this._num) < 300){
                div.style.backgroundColor = "#79ecd6";
            }else if(parseInt(this._num) >=300 && parseInt(this._num) < 500) {
                div.style.backgroundColor = "#4cdcc0";
            }else if(parseInt(this._num) >=500 && parseInt(this._num) < 700) {
                div.style.backgroundColor = "#33c3a7";
            }else {
                div.style.backgroundColor = "#26b095";
            }
            var span = this._span = document.createElement("span");
            div.appendChild(span);
            span.appendChild(document.createTextNode(this._text));
            //var that = this;
            var arrow = this._arrow = document.createElement("p");
            arrow.style.position = "absolute";
            arrow.style.width = "11px";
            arrow.style.height = "10px";
            arrow.style.top = "22px";
            arrow.style.left = "29%";
            div.appendChild(arrow);
            arrow.appendChild(document.createTextNode(this._num));
            var ply = [];
            var status;
            div.onmouseenter = function(){
                //pay = [];
                status = true;
                this.style.backgroundColor = "#e84a01";
                var bdary = new BMap.Boundary();

                bdary.get(data.name, function(rs){       //获取行政区域
                    //map.removeOverlay(ply);
                    var count = rs.boundaries.length; //行政区域的点有多少个
                    if (count === 0) {
                        toastr.error('未能获取当前输入行政区域');
                        return ;
                    }
                    var pointArray = [];
                    for (var i = 0; i < count; i++) {
                        var p = new BMap.Polygon(rs.boundaries[i],  {strokeColor:"#e84a01", strokeWeight:4, strokeOpacity:0.0, fillOpacity: 0.0, fillColor: "none"}); //建立多边形覆盖物
                        if(status == true){
                            map.addOverlay(p);  //添加覆盖物
                        }

                        pointArray = pointArray.concat(p.getPath());
                        ply.push(p)
                    }
                });
            };
            div.onmouseleave = function(){
                if(parseInt(this.children[1].innerText) < 300){
                    div.style.backgroundColor = "#79ecd6";
                }else if(parseInt(this.children[1].innerText) >=300 && parseInt(this.children[1].innerText) < 500) {
                    div.style.backgroundColor = "#4cdcc0";
                }else if(parseInt(this.children[1].innerText) >=500 && parseInt(this.children[1].innerText) < 700) {
                    div.style.backgroundColor = "#33c3a7";
                }else {
                    div.style.backgroundColor = "#26b095";
                }
                status = false;
                var p;
                while(p = ply.pop()){
                    map.removeOverlay(p);
                }
            };
            div.onclick = function() {
                scrollFlag = false;
                flag = true;
                map.clearOverlays();
                var zone_number = {province:data.zoneNumber,level:2};
                RequestData(aroundAccountUrl,zone_number);
                if(allMapData.length==0 || mapDataStatus==false){
                    return
                }
                $("#city").val(data.zoneNumber);
                map.centerAndZoom(new BMap.Point(allMapData[0].lng, allMapData[0].lat),8);
                createDeveloperCity(allMapData);
            };

            map.getPanes().labelPane.appendChild(div);

            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
            this._div.style.top  = pixel.y - 30 + "px";
        };
        var pt = new BMap.Point(data.lng,data.lat);
        var count = data.count + "个";
        myCompOverlay = new ComplexCustomOverlay(pt, data.name, count);
        map.addOverlay(myCompOverlay);
    });
    scrollFlag = true;
}
//开发商市覆盖物
function createDeveloperCity(mapDataList){
    mapDataList.forEach(function (data) {
        //自定义覆盖物
        function ComplexCustomOverlay(point, text,num){
            this._point = point;
            this._text = text;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
            div.style.color = "white";
            div.style.height = "80px";
            div.style.width = "80px";
            div.style.lineHeight = "62px";
            div.style.opacity = '0.9';
            div.style.textAlign = "center";
            div.style.borderRadius = "50%";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            if(parseInt(this._num) < 300){
                div.style.backgroundColor = "#79ecd6";
            }else if(parseInt(this._num) >=300 && parseInt(this._num) < 500) {
                div.style.backgroundColor = "#4cdcc0";
            }else if(parseInt(this._num) >=500 && parseInt(this._num) < 700) {
                div.style.backgroundColor = "#33c3a7";
            }else {
                div.style.backgroundColor = "#26b095";
            }
            var span = this._span = document.createElement("span");
            div.appendChild(span);
            span.appendChild(document.createTextNode(this._text));
            //var that = this;
            var arrow = this._arrow = document.createElement("p");
            arrow.style.position = "absolute";
            arrow.style.width = "11px";
            arrow.style.height = "10px";
            arrow.style.top = "22px";
            arrow.style.left = "29%";
            div.appendChild(arrow);
            arrow.appendChild(document.createTextNode(this._num));
            var ply = [];
            var status;
            div.onmouseenter = function(){
                //pay = [];
                status = true;
                this.style.backgroundColor = "#e84a01";
                var bdary = new BMap.Boundary();

                bdary.get(data.name, function(rs){       //获取行政区域
                    //map.removeOverlay(ply);
                    var count = rs.boundaries.length; //行政区域的点有多少个
                    if (count === 0) {
                        toastr.error('未能获取当前输入行政区域');
                        return ;
                    }
                    var pointArray = [];
                    for (var i = 0; i < count; i++) {
                        var p = new BMap.Polygon(rs.boundaries[i],  {strokeColor:"#e84a01", strokeWeight:4, strokeOpacity:0.0, fillOpacity: 0.0, fillColor: "none"}); //建立多边形覆盖物
                        if(status == true){
                            map.addOverlay(p);  //添加覆盖物
                        }

                        pointArray = pointArray.concat(p.getPath());
                        ply.push(p)
                    }
                });
            };
            div.onmouseleave = function(){
                if(parseInt(this.children[1].innerText) < 300){
                    div.style.backgroundColor = "#79ecd6";
                }else if(parseInt(this.children[1].innerText) >=300 && parseInt(this.children[1].innerText) < 500) {
                    div.style.backgroundColor = "#4cdcc0";
                }else if(parseInt(this.children[1].innerText) >=500 && parseInt(this.children[1].innerText) < 700) {
                    div.style.backgroundColor = "#33c3a7";
                }else {
                    div.style.backgroundColor = "#26b095";
                }
                status = false;
                var p;
                while(p = ply.pop()){
                    map.removeOverlay(p);
                }
            };
            div.onclick = function() {
                scrollFlag = false;
                flag = true;
                map.clearOverlays();
                $("#city").val(data.zoneNumber);
                $("#s2id_city span:first").html(data.name);
                $("#city").change();
            };

            map.getPanes().labelPane.appendChild(div);

            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
            this._div.style.top  = pixel.y - 30 + "px";
        };
        var pt = new BMap.Point(data.lng,data.lat);
        var count = data.count + "个";
        myCompOverlay = new ComplexCustomOverlay(pt, data.name, count);
        map.addOverlay(myCompOverlay);
    });
    scrollFlag = true;
}
//开发商行政区覆盖物
function createDeveloperDistrict(mapDataList){
    mapDataList.forEach(function (data) {
        //自定义覆盖物
        function ComplexCustomOverlay(point, text,num){
            this._point = point;
            this._text = text;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
            div.style.color = "white";
            div.style.height = "80px";
            div.style.width = "80px";
            div.style.lineHeight = "62px";
            div.style.opacity = '0.9';
            div.style.textAlign = "center";
            div.style.borderRadius = "50%";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            if(parseInt(this._num) < 300){
                div.style.backgroundColor = "#79ecd6";
            }else if(parseInt(this._num) >=300 && parseInt(this._num) < 500) {
                div.style.backgroundColor = "#4cdcc0";
            }else if(parseInt(this._num) >=500 && parseInt(this._num) < 700) {
                div.style.backgroundColor = "#33c3a7";
            }else {
                div.style.backgroundColor = "#26b095";
            }
            var span = this._span = document.createElement("span");
            div.appendChild(span);
            span.appendChild(document.createTextNode(this._text));
            //var that = this;
            var arrow = this._arrow = document.createElement("p");
            arrow.style.position = "absolute";
            arrow.style.width = "11px";
            arrow.style.height = "10px";
            arrow.style.top = "22px";
            arrow.style.left = "29%";
            div.appendChild(arrow);
            arrow.appendChild(document.createTextNode(this._num));
            var ply = [];
            var status;
            div.onmouseenter = function(){
                //pay = [];
                status = true;
                this.style.backgroundColor = "#e84a01";
                var bdary = new BMap.Boundary();

                bdary.get(data.name, function(rs){       //获取行政区域
                    //map.removeOverlay(ply);
                    var count = rs.boundaries.length; //行政区域的点有多少个
                    if (count === 0) {
                        toastr.error('未能获取当前输入行政区域');
                        return ;
                    }
                    var pointArray = [];
                    for (var i = 0; i < count; i++) {
                        var p = new BMap.Polygon(rs.boundaries[i],  {strokeColor:"#e84a01", strokeWeight:4, strokeOpacity:0.0, fillOpacity: 0.0, fillColor: "none"}); //建立多边形覆盖物
                        if(status == true){
                            map.addOverlay(p);  //添加覆盖物
                        }

                        pointArray = pointArray.concat(p.getPath());
                        ply.push(p)
                    }
                });
            };
            div.onmouseleave = function(){
                if(parseInt(this.children[1].innerText) < 300){
                    div.style.backgroundColor = "#79ecd6";
                }else if(parseInt(this.children[1].innerText) >=300 && parseInt(this.children[1].innerText) < 500) {
                    div.style.backgroundColor = "#4cdcc0";
                }else if(parseInt(this.children[1].innerText) >=500 && parseInt(this.children[1].innerText) < 700) {
                    div.style.backgroundColor = "#33c3a7";
                }else {
                    div.style.backgroundColor = "#26b095";
                }
                status = false;
                var p;
                while(p = ply.pop()){
                    map.removeOverlay(p);
                }
            };
            div.onclick = function() {
                scrollFlag = false;
                flag = true;
                map.clearOverlays();
                var zone_number = {district:data.zoneNumber};
                RequestData(accountSearchUrl,zone_number);
                if(allMapData.length==0 || mapDataStatus==false){
                    return
                }
                map.centerAndZoom(new BMap.Point(allMapData[0].lng, allMapData[0].lat),16);
                createAccount(allMapData);
            };

            map.getPanes().labelPane.appendChild(div);

            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
            this._div.style.top  = pixel.y - 30 + "px";
        };
        var pt = new BMap.Point(data.lng,data.lat);
        var count = data.count + "个";
        myCompOverlay = new ComplexCustomOverlay(pt, data.name, count);
        map.addOverlay(myCompOverlay);
    });
    scrollFlag = true;
}
//开发商覆盖物
function createDeveloper(paramsData) {
    paramsData.forEach(function (Community) {
        //自定义小区覆盖物
        function ComplexCustomOverlay(point, text,num){
            this._point = point;
            this._text = text;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.backgroundColor = "#26b095";
            div.style.color = "white";
            div.style.height = "60px";
            div.style.width = "60px";
            div.style.textAlign = "center";
            div.style.borderRadius = "50%";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            div.style.zIndex = "-11";
            if(this._num < 5){
                div.style.backgroundColor = "#79ecd6";
            }else if(this._num >= 5 && this._num < 10) {
                div.style.backgroundColor = "#4cdcc0";
            }else if(this._num >= 10 && this._num < 15) {
                div.style.backgroundColor = "#33c3a7";
            }else {
                div.style.backgroundColor = "#26b095";
            }
            var cont = document.createElement("div");
            cont.style.marginTop = "20%";
            var span = this._span = document.createElement("p");
            span.appendChild(document.createTextNode("笔"));
            span.style.margin = "0";
            //var that = this;
            var arrow = this._arrow = document.createElement("p");
            arrow.style.left = "17px";
            arrow.style.margin = "0";
            cont.appendChild(arrow);
            cont.appendChild(span);
            div.appendChild(cont);
            var message = document.createElement("div");
            message.style.width = "160px";
            message.style.height = "50px";
            message.style.background = "#FFFFFF";
            message.style.opacity = ".8";
            message.style.borderTopRightRadius = "25px";
            message.style.borderBottomRightRadius = "25px";
            message.style.position = "absolute";
            message.style.top = "5px";
            message.style.zIndex = "-10";
            message.style.color = "#666666";
            message.style.lineHeight = "50px";
            message.style.display = "none";
            message.style.textAlign = "center";
            message.style.border = "1px solid #e84a01";
            message.style.boxSizing = "border-box";
            message.style.left = "40px";
            message.style.fontSize = "14px";
            message.style.boxShadow = "0 0 6px #092923";
            message.appendChild(document.createTextNode(this._text));
            div.appendChild(message);
            arrow.appendChild(document.createTextNode(this._num));

            div.onmouseenter = function(){
                this.style.backgroundColor = "#e84a01";
                message.style.display = "block";
                this.style.zIndex = "auto";
                message.style.zIndex = "-10";
            };
            div.onmouseleave = function(){
                //this.style.backgroundColor = "#26b095";
                if(this.children[0].children[0].innerText < 5){
                    div.style.backgroundColor = "#79ecd6";
                }else if(this.children[0].children[0].innerText >= 5 && this.children[0].children[0].innerText < 10) {
                    div.style.backgroundColor = "#4cdcc0";
                }else if(this.children[0].children[0].innerText >= 10 && this.children[0].children[0].innerText < 15) {
                    div.style.backgroundColor = "#33c3a7";
                }else {
                    div.style.backgroundColor = "#26b095";
                }
                message.style.display = "none";
                this.style.zIndex = "-11";
            };
            div.onclick = function() {
                scrollFlag = false;
                map.clearOverlays();
                var inputData = getInputData();
                inputData.accountId=Community.accountId;
                RequestData(accountCommunityUrl,inputData);
                map.centerAndZoom(new BMap.Point(Community.lng, Community.lat),19);
                createDeveloperCommunity(allMapData);
            };

            map.getPanes().labelPane.appendChild(div);
            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
            this._div.style.top  = pixel.y - 30 + "px";
        };
        var pt = new BMap.Point(Community.lng,Community.lat);
        myCompOverlay = new ComplexCustomOverlay(pt, Community.accountName, Community.count);
        map.addOverlay(myCompOverlay);
    });
    scrollFlag = true;
}
//开发商小区覆盖物
function createDeveloperCommunity (paramsData) {
    paramsData.forEach(function (Community) {
        //自定义小区覆盖物
        function ComplexCustomOverlay(point, text,num){
            this._point = point;
            this._text = text;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.backgroundColor = "#26b095";
            div.style.color = "white";
            div.style.height = "60px";
            div.style.width = "60px";
            div.style.textAlign = "center";
            div.style.borderRadius = "50%";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            div.style.zIndex = "-11";
            if(this._num < 5){
                div.style.backgroundColor = "#79ecd6";
            }else if(this._num >= 5 && this._num < 10) {
                div.style.backgroundColor = "#4cdcc0";
            }else if(this._num >= 10 && this._num < 15) {
                div.style.backgroundColor = "#33c3a7";
            }else {
                div.style.backgroundColor = "#26b095";
            }
            var cont = document.createElement("div");
            cont.style.marginTop = "20%";
            var span = this._span = document.createElement("p");
            span.appendChild(document.createTextNode("笔"));
            span.style.margin = "0";
            //var that = this;
            var arrow = this._arrow = document.createElement("p");
            arrow.style.left = "17px";
            arrow.style.margin = "0";
            cont.appendChild(arrow);
            cont.appendChild(span);
            div.appendChild(cont);
            var message = document.createElement("div");
            message.style.width = "160px";
            message.style.height = "50px";
            message.style.background = "#FFFFFF";
            message.style.opacity = ".8";
            message.style.borderTopRightRadius = "25px";
            message.style.borderBottomRightRadius = "25px";
            message.style.position = "absolute";
            message.style.top = "5px";
            message.style.zIndex = "-10";
            message.style.color = "#666666";
            message.style.lineHeight = "50px";
            message.style.display = "none";
            message.style.textAlign = "center";
            message.style.border = "1px solid #e84a01";
            message.style.boxSizing = "border-box";
            message.style.left = "40px";
            message.style.fontSize = "14px";
            message.style.boxShadow = "0 0 6px #092923";
            message.appendChild(document.createTextNode(this._text));
            div.appendChild(message);
            arrow.appendChild(document.createTextNode(this._num));

            div.onmouseenter = function(){
                this.style.backgroundColor = "#e84a01";
                message.style.display = "block";
                this.style.zIndex = "auto";
                message.style.zIndex = "-10";
            };
            div.onmouseleave = function(){
                //this.style.backgroundColor = "#26b095";
                if(this.children[0].children[0].innerText < 5){
                    div.style.backgroundColor = "#79ecd6";
                }else if(this.children[0].children[0].innerText >= 5 && this.children[0].children[0].innerText < 10) {
                    div.style.backgroundColor = "#4cdcc0";
                }else if(this.children[0].children[0].innerText >= 10 && this.children[0].children[0].innerText < 15) {
                    div.style.backgroundColor = "#33c3a7";
                }else {
                    div.style.backgroundColor = "#26b095";
                }
                message.style.display = "none";
                this.style.zIndex = "-11";
            };

            map.getPanes().labelPane.appendChild(div);
            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
            this._div.style.top  = pixel.y - 30 + "px";
        };
        var pt = new BMap.Point(Community.lng,Community.lat);
        myCompOverlay = new ComplexCustomOverlay(pt, Community.communityName, Community.count);
        map.addOverlay(myCompOverlay);
        createDeveloperBuilding(Community.buildList[0])
    });
    scrollFlag = true;
}
//开发商楼栋覆盖物
function createDeveloperBuilding(paramsData){
    paramsData.forEach(function (searchEstate) {
        //自定义楼栋覆盖物
        function ComplexCustomOverlay(point,num){
            this._point = point;
            this._num = num;
        }
        ComplexCustomOverlay.prototype = new BMap.Overlay();
        ComplexCustomOverlay.prototype.initialize = function(map){
            this._map = map;
            var div = this._div = document.createElement("div");
            div.style.position = "absolute";
            div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
            div.style.backgroundColor = "#26b095";
            div.style.color = "white";
            div.style.height = "30px";
            div.style.lineHeight = "18px";
            div.style.opacity = '0.9';
            div.style.textAlign = "center";
            div.style.borderRadius = "4px";
            div.style.whiteSpace = "nowrap";
            div.style.MozUserSelect = "none";
            div.style.fontSize = "12px";
            div.style.cursor = "pointer";
            div.style.padding = "6px";
            div.appendChild(document.createTextNode(this._num));
            var sj = this._p = document.createElement("p");
            sj.style.position = "absolute";
            sj.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
            sj.style.width = 0;
            sj.style.height = 0;
            sj.style.borderTop = "10px solid #26b095";
            sj.style.borderLeft = "10px solid transparent";
            sj.style.borderRight = "10px solid transparent";
            sj.style.bottom = "-20px";
            sj.style.left = "25%";
            div.appendChild(sj);
            div.onmouseenter = function(){
                this.style.backgroundColor = "#e84a01";
                sj.style.borderTop = "10px solid #e84a01";
            };
            div.onmouseleave = function(){
                this.style.backgroundColor = "#26b095";
                sj.style.borderTop = "10px solid #26b095";
            };
            var o = 0;
            var ul = document.createElement("div");
            div.onclick = function () {
                o++;
                $(this).siblings("div").children("div.hpanel").css("display","none");
                div.style.zIndex = "auto";
                $(this).siblings("div").css("zIndex","-10");
                if(o == 1){
                    ul.className = "hpanel";
                    ul.style.position = "absolute";
                    ul.style.top = "0";
                    ul.style.display = "block";
                    var body = document.createElement("div");
                    body.className = "panel-body list";
                    body.style.overflowY = "scroll";
                    var container = document.createElement("div");
                    container.className = "list-item-container";
                    container.style.maxHeight = "200px";
                    div.appendChild(ul);
                    body.appendChild(container);
                    ul.appendChild(body);
                    var allAreaResult = searchEstate.estateList;

                    allAreaResult.forEach(function(data){
                        data.forEach(function (data){
                            var item = document.createElement("div");
                            item.className = "list-item";
                            item.style.overflowX = "inherit";
                            var h3 = document.createElement("h3");
                            h3.className = "no-margins font-extra-bold text-success";
                            h3.style.fontSize = "12px";
                            if(data.cltv > 60 && data.cltv <= 80){
                                h3.style.color = "#FF9800";
                            }else if(data.cltv > 80 && data.cltv <= 100){
                                h3.style.color = "#E51C23";
                            }else if(data.cltv >= 100){
                                h3.style.color = "#8B1818";
                            }
                            h3.appendChild(document.createTextNode(data.sourceAddress));
                            item.appendChild(h3);
                            container.appendChild(item);
                            item.onclick = function () {
                                var href = window.location.origin + "/estate/mapShow/" + data.id;
                                window.open(href);
                            };
                        })
                    });
                    ul.style.left = div.offsetWidth + "px";
                }else if(ul.style.display == "block"){
                    ul.style.display = "none";
                }else{
                    ul.style.display = "block"
                }
                ul.onmouseenter = function () {
                    disableScroll(map);
                };
                ul.onmouseleave = function () {
                    endisableScroll(map);
                };
            };
            map.getPanes().labelPane.appendChild(div);
            return div;
        };
        ComplexCustomOverlay.prototype.draw = function(){
            var map = this._map;
            var pixel = map.pointToOverlayPixel(this._point);
            this._div.style.left = pixel.x + "px";
            this._div.style.top  = pixel.y + "px";
        };
        var pt = new BMap.Point(searchEstate.lng,searchEstate.lat);
        var areaResult = searchEstate.estateList[0].length + "笔";
        myCompOverlay = new ComplexCustomOverlay(pt, areaResult);
        map.addOverlay(myCompOverlay);
    });
    scrollFlag = true;
}
function disableScroll (map) {
    map.disableScrollWheelZoom();
}
function endisableScroll (map) {
    map.enableScrollWheelZoom();
}